package cc.vv.baselibrary.view

import android.content.Context
import android.view.Gravity
import android.view.LayoutInflater
import android.widget.Toast
import cc.vv.baselibrary.R

/**
 * 音频录制时间过短提示
 * Created by sun.li on 2018/10/23.
 * @author sun.li
 */
object VoiceToShortToast{

    private var mToast: Toast? = null

    fun show(context: Context){
        if(null==context){
            return
        }
        try {
            val layoutInflater = LayoutInflater.from(context)
            val view = layoutInflater.inflate(R.layout.dialog_recording_voice_to_short, null)
            mToast = Toast(context)
            mToast?.setGravity(Gravity.CENTER,0,0)
            mToast?.view = view
            mToast?.duration = Toast.LENGTH_SHORT
            mToast?.show()
        } catch (e: Exception) {
            e.printStackTrace()
        }
    }

}